Python Package Management
PIP
Reduce size
# smaller pip install --no-cache-dir --requirement /app/requirements.txt
Upgrade files in requirements.txt
pip install pip-upgrader pip-upgrade
- PIPx — install and run in isolated env
pip list |awk '{print $1}'|egrep -v 'Package|^--' |xargs pip install -U pip list --outdated # -o pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U pip3 list -o | cut -f1 -d' ' | tr " " "\n" | awk '{if(NR>=3)print)' | cut -d' ' -f1 | xargs -n1 pip3 install -U pip install -r requirements.txt --upgrade pip freeze
Pipenv
Wheel File Format
Making Private Packages
- Use a setup.py at the top of a git repo
- Install with `pip install
- Use a setup.py at the top of a git repo